package embyparse.util;

import java.util.ArrayList;

import embyparse.tokenizer.Token;

public class TokenArrayListStream implements TokenStream{

	ArrayList<Token> tokens;
	int counter = -1;
	public TokenArrayListStream(ArrayList<Token> tok){
		tokens = tok;
	}

	public Token next(){
		counter++;
		return tokens.get(counter);
	}

	public boolean hasNext(){
		return counter<tokens.size()-1;
	}

	@Override
	public void close() {
		tokens = new ArrayList<Token>();
	}
}
